<?php

function openConnection(){
	
	$host = "127.0.0.1";
	$port = "5432";
	$dbname = "avance";
	$user = "postgres";
	$pass = "123";
	
	$connect = pg_connect("host=".$host." port=".$port." dbname=".$dbname." user=".$user." password=".$pass) 
	or die ("Nao consegui conectar ao Postgres --> " . pg_last_error($connect));
	return $connect;
}

function closeConnetion($connect){
	pg_close($connect);	
}
?>
